package org.elsfs.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.Instant;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 用户实体
 *
 * @author zeng
 * @since 0.0.1
 */
@Data
@TableName("sys_user")
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Builder
public class SysUser implements Serializable {

  @TableId(type = IdType.ASSIGN_ID)
  private String userId;

  private String phone;
  private String email;
  // 用户昵称
  private String nickname;
  private String password;
  private String username;
  private String avatar;

  /** 创建人 */
  private String createBy;

  /** 创建时间 */
  @TableField(fill = FieldFill.INSERT)
  private Instant createTime;

  /** 更新人 */
  private String updateBy;

  /** 更新时间 */
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Instant updateTime;

  /** 逻辑删除标记(0--正常 1--删除) */
  @TableLogic private Boolean isDeleted;
}
